home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / MPW Interfaces & Libraries / CIncludes / CommResources.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-01-29  |  3.1 KB  |  109 lines  |  [TEXT/MPS ]

  1.  
  2. /************************************************************
  3.  
  4. Created: Thursday, September 12, 1991 at 11:53 AM
  5.  CommResources.h
  6.  C Interface to the Macintosh Libraries
  7.  
  8.  
  9.   Copyright Apple Computer, Inc. 1988-1991
  10.   All rights reserved
  11.  
  12. ************************************************************/
  13.  
  14.  
  15. #ifndef __COMMRESOURCES__
  16. #define __COMMRESOURCES__
  17.  
  18. #ifndef __OSUTILS__
  19. #include <OSUtils.h>
  20. #endif
  21.  
  22.  
  23. enum {
  24.  
  25.  
  26. /*    version of the Comm Resource Manager    */
  27.  curCRMVersion = 2,
  28.  
  29. /*    tool classes (also the tool file types)    */
  30.  
  31. #define classCM 'cbnd'
  32. #define classFT 'fbnd'
  33. #define classTM 'tbnd'
  34.  
  35. /* constants general to the use of the Communications Resource Manager */
  36.  
  37.  crmType = 9,            /* queue type    */
  38.  crmRecVersion = 1,        /* version of queue structure */
  39.  
  40. /*    error codes */
  41.  crmGenericError = -1,
  42.  crmNoErr = 0
  43. };
  44.  
  45. /* data structures general to the use of the Communications Resource Manager */
  46. typedef OSErr CRMErr;
  47.  
  48. struct CRMRec {
  49.  QElemPtr qLink;        /*reserved*/
  50.  short qType;            /*queue type -- ORD(crmType) = 9*/
  51.  short crmVersion;        /*version of queue element data structure*/
  52.  long crmPrivate;        /*reserved*/
  53.  short crmReserved;        /*reserved*/
  54.  long crmDeviceType;    /*type of device, assigned by DTS*/
  55.  long crmDeviceID;        /*device ID; assigned when CRMInstall is called*/
  56.  long crmAttributes;    /*pointer to attribute block*/
  57.  long crmStatus;        /*status variable - device specific*/
  58.  long crmRefCon;        /*for device private use*/
  59. };
  60.  
  61. typedef struct CRMRec CRMRec;
  62. typedef CRMRec *CRMRecPtr;
  63.  
  64.  
  65. #ifdef __cplusplus
  66. extern "C" {
  67. #endif
  68. pascal CRMErr InitCRM(void); 
  69. pascal QHdrPtr CRMGetHeader(void); 
  70. pascal void CRMInstall(QElemPtr crmReqPtr); 
  71. pascal OSErr CRMRemove(QElemPtr crmReqPtr); 
  72. pascal QElemPtr CRMSearch(QElemPtr crmReqPtr); 
  73. pascal short CRMGetCRMVersion(void); 
  74.  
  75. pascal Handle CRMGetResource(ResType theType,short theID); 
  76. pascal Handle CRMGet1Resource(ResType theType,short theID); 
  77. pascal Handle CRMGetIndResource(ResType theType,short index); 
  78. pascal Handle CRMGet1IndResource(ResType theType,short index); 
  79. pascal Handle CRMGetNamedResource(ResType theType,ConstStr255Param name); 
  80. pascal Handle CRMGet1NamedResource(ResType theType,ConstStr255Param name); 
  81. pascal void CRMReleaseResource(Handle theHandle); 
  82. pascal Handle CRMGetToolResource(short procID,ResType theType,short theID); 
  83. pascal Handle CRMGetToolNamedResource(short procID,ResType theType,ConstStr255Param name); 
  84. pascal void CRMReleaseToolResource(short procID,Handle theHandle); 
  85. pascal long CRMGetIndex(Handle theHandle); 
  86.  
  87. pascal short CRMLocalToRealID(ResType bundleType,short toolID,ResType theType,
  88.  short localID); 
  89. pascal short CRMRealToLocalID(ResType bundleType,short toolID,ResType theType,
  90.  short realID); 
  91.  
  92. pascal OSErr CRMGetIndToolName(OSType bundleType,short index,Str255 toolName); 
  93.  
  94. pascal OSErr CRMFindCommunications(short *vRefNum,long *dirID); 
  95.  
  96. pascal Boolean CRMIsDriverOpen(ConstStr255Param driverName); 
  97.  
  98. pascal CRMErr CRMParseCAPSResource(Handle theHandle,ResType selector,unsigned long *value); 
  99.  
  100. pascal OSErr CRMReserveRF(short refNum); 
  101. /*  decrements useCount by one  */
  102. pascal OSErr CRMReleaseRF(short refNum); 
  103.  
  104. #ifdef __cplusplus
  105. }
  106. #endif
  107.  
  108. #endif
  109.